package demo.service;

import com.github.pagehelper.PageInfo;
import demo.common.JudgeStatusEnum;
import demo.entity.Problem;
import demo.entity.ProblemResult;
import demo.entity.TestcaseResult;
import demo.request.ProblemRequest;
import demo.response.ProblemDetailVO;
import demo.response.ProblemResultRecentVO;
import demo.response.RestResponseVO;
import demo.response.ServerResponse;

import java.util.List;

public interface ProblemService {

    RestResponseVO<Problem> getById(Integer problemId);

    RestResponseVO insert(ProblemRequest problemRequest);

    RestResponseVO delById(Integer id);

    RestResponseVO<Problem> updateById(ProblemRequest problemRequest);

    RestResponseVO<PageInfo> listProblemVOToPage(Integer userId,Integer flag,Integer sort,String keyword, Integer level, String tagIds, Integer pageNum, Integer pageSize);

    RestResponseVO<List<ProblemDetailVO>> listSuggestProblem(Integer problemId, Integer row);

    RestResponseVO<Integer> randomProblemId();

    RestResponseVO<ProblemDetailVO> getDetailVOById(Integer problemId);




    Problem getProblemById(Integer problemId);

    ProblemResult getProblemResultById(Integer problemResultId);

    ProblemResult getProblemResultByRunNum(String runNum);

    ServerResponse insertProblemResult(ProblemResult result);

    ServerResponse updateProblemById(Problem problem);

    ServerResponse updateProblemResultStatusById(Integer problemResultId, Integer status);

    ServerResponse updateProblemResultById(ProblemResult problemResult);

    ServerResponse addProblemCountById(Integer problemId, JudgeStatusEnum statusConst);

    ServerResponse insertBatchTestcaseResult(List<TestcaseResult> testcaseResultList);

    int countProblemResult(Integer userId,Integer problemId,Integer status);

    ServerResponse addCompScoreById(Integer compScore,Integer problemResultId);

    Integer getTotalScoreById( Integer userId, Integer compId);

}
